<?php
class Recharge_log_model extends BZ_Model
{
    protected $table = 'order_base';
    
    public function total($search_param=array())
    {
        $this->db->where('cat_id', 256);//充值
        
        if (!empty($search_param['uid'])) {
            $this->db->where('payer_uid', $search_param['uid']);
        }
        return $this->db->count_all_results($this->table);
    }
    
    public function page_list($page_num, $num, $search_param=array())
    {
        $this->db->select('order_id,goods_name,amount_total,ordertime,bit_pay');
        $this->db->where('cat_id', 256);//充值
        
        if (!empty($search_param['uid'])) {
            $this->db->where('payer_uid', $search_param['uid']);
        }
        $this->db->order_by('order_id', 'desc');
        $this->db->limit($page_num, $num);
        return $this->db->get($this->table);
    } 
}